package com.gqyin.cloud.ai.demo.service.impl;

import com.gqyin.cloud.ai.demo.service.TongYiService;
import org.springframework.ai.chat.messages.AssistantMessage;
import org.springframework.ai.image.ImageResponse;

import java.util.Map;

/**
 * @author guiqing.yin
 * @Date 2024-05-14 16:39
 */
public abstract class AbstractTongYiServiceImpl implements TongYiService {

    private static final String INFO_PREFIX = "Please implement ";
    private static final String INFO_SUFFIX = "() method.";

    @Override
    public String completion(String message) {
        throw new RuntimeException(INFO_PREFIX + Thread.currentThread().getStackTrace()[2].getMethodName());
    }

    @Override
    public Map<String, String> streamCompletion(String message) {
        throw new RuntimeException(INFO_PREFIX + Thread.currentThread().getStackTrace()[2].getMethodName() + INFO_SUFFIX);
    }

    @Override
    public AssistantMessage genPromptTemplates(String adjective, String topic) {
        throw new RuntimeException(INFO_PREFIX + Thread.currentThread().getStackTrace()[2].getMethodName() + INFO_SUFFIX);
    }

    @Override
    public AssistantMessage genRole(String message, String name, String voice) {
        throw new RuntimeException(INFO_PREFIX + Thread.currentThread().getStackTrace()[2].getMethodName() + INFO_SUFFIX);
    }

    @Override
    public ImageResponse genImage(String imagePrompt) {
        throw new RuntimeException(INFO_PREFIX + Thread.currentThread().getStackTrace()[2].getMethodName() + INFO_SUFFIX);
    }

    @Override
    public String genAudio(String text) {
        throw new RuntimeException(INFO_PREFIX + Thread.currentThread().getStackTrace()[2].getMethodName() + INFO_SUFFIX);
    }
}
